#pragma once
#include "_afxColl_.h"

class CObject;
class CHandleMap {
 private:
  CMapPtrToPtr m_permanetMap;

 public:
  CObject* LookupPermanet(HANDLE h);
  void SetPermanet(HANDLE h, CObject* permOb);
  void RemoveHandle(HANDLE h);
  CObject* FromHandle(HANDLE h);
};

__inline CObject* CHandleMap::LookupPermanet(HANDLE h) {
  return (CObject*)m_permanetMap[h];
}
__inline void CHandleMap::SetPermanet(HANDLE h, CObject* permOb) {
  m_permanetMap[h] = permOb;
}

__inline void CHandleMap::RemoveHandle(HANDLE h) { m_permanetMap.RemoveKey(h); }

__inline CObject* CHandleMap::FromHandle(HANDLE h) { return LookupPermanet(h); }